package com.haven.webrobotserver.domain;


import java.util.Objects;

public class EndRunner {
    private String ip;
    private long lastHeartBeatTime;

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public long getLastHeartBeatTime() {
        return lastHeartBeatTime;
    }

    public void setLastHeartBeatTime(long lastHeartBeatTime) {
        this.lastHeartBeatTime = lastHeartBeatTime;
    }

    @Override
    public boolean equals(Object o) {
        Class<?> aClass = o.getClass();
        if(aClass != this.getClass()){
            throw new ClassCastException();
        }

        EndRunner e = (EndRunner)o;
       return this.getIp().equals(e.getIp());
    }

    @Override
    public int hashCode() {
        return Objects.hash(ip);
    }

    @Override
    public String toString() {
        return "EndRunner{" +
                "ip='" + ip + '\'' +
                ", lastHeartBeatTime=" + lastHeartBeatTime +
                '}';
    }
}
